import java.io.File;

public class test4 {
    public static void main(String[] args) {
        File file = new File("E:\\abcd");
        delete(file);
    }

    public static void delete(File file) {
        File[] files = file.listFiles();
        for(File f : files) {
            if(f.isDirectory()) {
                delete(f);
                f.delete();
            }
            else{
                f.delete();
            }
        }
    }
}
